home *** CD-ROM | disk | FTP | other *** search
- Path: gwen.pcug.co.uk!altheim!broldham
- Newsgroups: comp.lang.c
- Message-ID: <1258@altheim.win-uk.net>
- References: <1239@altheim.win-uk.net><18MAR199607594276@erich.triumf.ca> <1242@altheim.win-uk.net><314EC8E6.216E@ix.netcom.com> <1245@altheim.win-uk.net><31533146.3340333@netline-fddi.jpl.nasa.gov>
- Reply-To: broldham@altheim.win-uk.net (Brian R. Oldham)
- From: broldham@altheim.win-uk.net (Brian R. Oldham)
- Date: Mon, 25 Mar 1996 10:29:28 GMT
- Subject: Re: Pointers to register
-
- Kevin and Kurt Watzka said roughly the same things so I'll answer them
- together...
-
- In article <31533146.3340333@netline-fddi.jpl.nasa.gov>, Kevin Quitt
- (kdq@emoryi.jpl.nasa.gov) writes:
- >On Wed, 20 Mar 1996 17:51:39 GMT, broldham@altheim.win-uk.net
- (Brian R. Oldham) wrote:
- >
- >>So back to my original question: why does the ostensibly incorrect
- >>declaration:
- >>
- >> *ptr = union_member_var;
- >>
- >>work, and the correct:
- >>
- >> ptr = &union_member_var;
- >>
- >>does not?
- >
- >First of all, it's because they're not declarations, they're statements.
-
- Phew! this is such hard work. So they are statements and not
- declarations (y'have to be so careful here <grumble> )
-
- >Secondly, they mean very different things. The former says "Take the
- >data in union_member_var and store it (starting) in the location whose
- >address is in ptr"; the latter says "Take the address of the variable
- >union_member_var and put it in the variable called ptr".
-
- So if the former is correct, then can I take it that the assignment of
- the pointer is done by the function parameters at the time of calling
- this function?
-
-
- ---
- Brian Oldham
- Hucknall UK
- !...Gesundbrunnen
-
-
-
-
-
-
-
-
-